/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.cemaden.smp.controler;

import br.gov.cemaden.library.model.smp.LoadAverage;
import java.io.Serializable;
import org.hyperic.sigar.jmx.SigarLoadAverage;

/**
 *
 * @author Simone Santos
 */
public class LoadAverageSystemBean implements Serializable {

    LoadAverage loadAv = new LoadAverage();
    
    public LoadAverageSystemBean() {
    }

    public LoadAverage getLoad() {
        SigarLoadAverage lo = new SigarLoadAverage();

        loadAv.setLoad1min(lo.getLastMinute());
        loadAv.setLoad5min(lo.getLastFiveMinutes());
        loadAv.setLoad15min(lo.getLast15Minutes());

        return loadAv;
    }

    public void show(LoadAverage t) {
        System.out.println("Load1min: " + t.getLoad1min());
        System.out.println("Load5min: " + t.getLoad5min());
        System.out.println("Load15min: " + t.getLoad15min());
        System.out.println("--------------------------------\n");
    }
}